﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;

namespace EkspSys.Network
{
    class GeoLookup
    {
        private static GeoLookup instance;

        private GeoLookup()
        {
        }

        public static GeoLookup Get()
        {
            if (instance == null)
                instance = new GeoLookup();
            return instance;
        }

        private LookupService lookupService =
            new LookupService("Resources/GeoLiteCity.dat",
                LookupService.GEOIP_STANDARD);

        public Location LookupIPLocation(IPAddress addr)
        {
            return lookupService.getLocation(addr);
        }
    }
}
